package com.xxl.job.executor.datagenerator;

import java.util.Random;

// 自定义线程安全的随机数生成器
public class ThreadLocalRandom {
    private static final ThreadLocal<Random> random = ThreadLocal.withInitial(Random::new);

    public static long nextLong(long min, long max) {
        if (min >= max) {
            throw new IllegalArgumentException("min must be less than max");
        }
        Random r = random.get();
        return r.nextLong(min, max);
    }
}
